<template>
  <div class="gendan">
    <Tabs :text="text">
      <Search @easySearch="easySearch" @data="upState" />
    </Tabs>
    <GendanHighSearch v-if="state" />
    <router-view></router-view>
  </div>
</template>

<script>
import Tabs from '../../components/Tabs.vue';
import Search from '../../components/Search.vue';
import GendanHighSearch from '../../components/GendanHightSearch.vue';
import { mapMutations } from 'vuex';

export default {
  components: {
    Tabs,
    Search,
    GendanHighSearch,
  },
  data() {
    return {
      state: false,
      val: '',
      text: [
        {
          id: '0',
          textName: '跟单列表',
          url: '/gendan/gendanlist',
        },
        {
          id: '1',
          textName: '今日需跟进',
          url: '/gendan/gendantoday',
        },
        {
          id: '2',
          textName: '本周需跟进',
          url: '/gendan/gendanweek',
        },
        {
          id: '3',
          textName: '今日跟单记录',
          url: '/gendan/gendantodaylog',
        },
        {
          id: '4',
          textName: '本周跟单记录',
          url: '/gendan/gendanweeklog',
        },
        {
          id: '5',
          textName: '本月跟单记录',
          url: '/gendan/gendanmonthlog',
        },
        {
          id: '6',
          textName: '新增跟单',
          url: '/gendan/gendanAdd',
        },
      ],
    };
  },
  methods: {
    ...mapMutations('gendanStore', ['setIsEasySearch']),
    ...mapMutations(['setSearchVal']),
    upState(data) {
      this.state = !data; //状态处理
    },
    easySearch(val) {
      this.setIsEasySearch(true);
      this.setSearchVal(val);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>